<script>
import Keyboard from "@/components/vant-number-plate/vnp-keyboard";

export default {
  components: {
    "vnp-keyboard": Keyboard,
  },
  data() {
    return {
      carNo: "",
      showInput: false,
    };
  },
  methods: {
    routerPush() {
      this.$store.commit("setPlateImg", "");
      this.$router.push({
        path: "/carForm",
        query: {
          parkspaceCode: this.$route.query.parkspaceCode,
          carNo: this.carNo,
          roadCode: this.$route.query.roadCode,
        },
      });
    },
  },
};
</script>
<template>
  <div class="entryCar">
    <vnp-keyboard v-model="carNo" :show.sync="showInput"></vnp-keyboard>
    <div class="entryCarHead">
      <van-nav-bar title="输入车牌">
        <template #left>
          <span
            style="font-size: 30px; background-color: #06c68a; padding: 4px 0"
            @click="$router.go(-1)"
            class="tc ting-fanhui"
            >返回
          </span>
        </template>
      </van-nav-bar>
    </div>
    <div class="entryCarTitle">请输入车牌号码</div>
    <div class="entryCar-content" @click="showInput = true">
      <van-password-input
        :mask="false"
        :gutter="10"
        :value="carNo"
        :length="8"
      />
    </div>
    <div class="entryCar-btn">
      <van-button @click="routerPush" type="primary" block>确定</van-button>
    </div>
  </div>
</template>

<style scoped lang="scss">
.entryCar {
  width: 100%;
  height: 100vh;
  padding-top: 48px;
  box-sizing: border-box;

  .entryCarHead {
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 999;
    box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.1);

    i {
      font-size: 20px;
    }
  }

  .entryCarTitle {
    padding: 20px 12px;
    box-sizing: border-box;
    font-size: 25px;
    font-weight: bold;
  }

  .entryCar-content {
    width: 100%;
  }

  .entryCar-btn {
    padding: 40px 12px;
    box-sizing: border-box;
  }
}
</style>
